/* Light Remote Make red LED light up when red button is pushed, and IR LED light up when IR button is pushed. */ // Define variables int red=0; int IR=1; int redButton=2; int IRButton=3; int delay_Value=1000; // the setup function runs once when you press reset or power the board void setup() { // Initialize digital pins on ATtiny1614 according to pin schematic and if they serve as inputs or outputs. pinMode(red, OUTPUT);pinMode(redButton,INPUT_PULLUP); pinMode(IR, OUTPUT);pinMode(IRButton,INPUT_PULLUP); } // the loop function runs over and over again forever void loop() { // Read button value into a variable int redButtonState = digitalRead(redButton); int IRButtonState = digitalRead(IRButton); // Pull-up means button logic is inverted. // HIGH is when it is open, LOW is when it is pressed // For red button and red LED: if (redButtonState == HIGH) { digitalWrite(red,LOW); } else { digitalWrite(red,HIGH); } // For IR button and IR LED: if (IRButtonState == HIGH) { digitalWrite(IR,LOW); } else { digitalWrite(IR,HIGH); } } // command to flash on to ATtiny 1614 after cd to containing directory: // python3 C:\Users\Omar\Desktop\ClassRepo\pyupdi\updi\pyupdi.py -d tiny412 -c /COM3 -b 115200 -f LightRemote.ino.hex